<html>
<head>
  <META http-equiv="content-type" content="text/html">
  <title> Adaptive tickets </title>
  <%= stylesheet_link_tag 'scaffold' %>
  <%= javascript_include_tag :defaults %>
  <%= calendar_date_select_includes "red"%>
</head>
<body>
<% if  params[:controller] != 'sessions' %>
<table border = "0" width = "100%">
<tr>
<td>

 
 <%= (params[:controller] == 'tickets' && params[:action] == 'index') ? ('<b> Tickets </b>') : (link_to 'Tickets', tickets_path) %>
<%= (params[:controller] == 'reports' && params[:action] == 'new') ? ('<b> Create new report </b>') : (link_to 'Create new report', '/reports/new') %>
 <% if current_user.admin? %>
<%= (params[:controller] == 'tickets' && params[:action] == 'clear_closed') ? ('<b> Clear closed tickets </b>') : (link_to 'Clear closed tickets', clear_closed_tickets_path) %>
 <%= (params[:controller] == 'ticket_templates' && params[:action] == 'index') ? ('<b> Ticket templates </b>') : (link_to 'Ticket templates', ticket_templates_path) %>
<%= (params[:controller] == 'report_templates' && params[:action] == 'index') ? ('<b> Report templates </b>') : (link_to 'Report templates', report_templates_path) %>
<%= (params[:controller] == 'users' && params[:action] == 'index') ? ('<b> Users </b>') : (link_to 'Users', users_path) %>
<%= (params[:controller] == 'groups' && params[:action] == 'index') ? ('<b> Groups </b>') : (link_to 'Groups', groups_path) %>

 <% end %>
</td>
<td align = 'right'>
 User: <%= current_user.login %>
 <%= (params[:controller] == 'users' && params[:action] == 'change_password') ? ('<b> Change password </b>') : (link_to 'Change password', "/change_password") %>
 <%= link_to 'Logout', "/logout" %>
  </td>
 </tr>
 </table>
<% end %> 
 <p style="color: green"><%= flash[:notice] %></p>
<h1><%= @heading %></h1>


<%= yield  %>

</body>
</html>
